@startuml
namespace db {
    class ClusterDetails << (S,Aquamarine) >> {
        + Status ClusterStatus
        + Resources []Resource
        + Services <font color=blue>map</font>[ServiceName]ServiceInfo

    }
    class Compose << (S,Aquamarine) >> {
        + Services <font color=blue>map</font>[string]<font color=blue>interface</font>{}

    }
    class MongoClient << (S,Aquamarine) >> {
    }
    class Project << (S,Aquamarine) >> {
        + DocumentID primitive.ObjectID
        + ID string
        + Tasks []*Task

    }
    class ProjectResult << (S,Aquamarine) >> {
        + Project *Project
        + Error error

    }
    class ProjectsRepository << (S,Aquamarine) >> {
        - log *zap.SugaredLogger
        - client *MongoClient
        - properties configuration.MongoProperties

        - init() error
        - updateByID(ctx context.Context, project *Project, update <font color=blue>interface</font>{}, opts ...*options.UpdateOptions) error
        - createChannel(limit int, block <font color=blue>func</font>() *mongo.SingleResult) <font color=blue>chan</font> ProjectResult
        - collection() *mongo.Collection

        + ListProjectsSince(ctx context.Context, point time.Time, limit int) <font color=blue>chan</font> ProjectResult
        + SaveProject(ctx context.Context, project *Project) error

    }
    class Resource << (S,Aquamarine) >> {
        + Kind string
        + Name string
        + BelongsTo string
        + Status ResourceStatus

    }
    class ServiceInfo << (S,Aquamarine) >> {
        + Endpoints []string

    }
    class Task << (S,Aquamarine) >> {
        + ID internal.TaskID
        + Status TaskStatus
        + Compose Compose
        + Clusters <font color=blue>map</font>[ClusterName]ClusterDetails

    }
    class db.ClusterName << (T, #FF7700) >>  {
    }
    class db.ClusterStatus << (T, #FF7700) >>  {
    }
    class db.ResourceStatus << (T, #FF7700) >>  {
    }
    class db.ServiceName << (T, #FF7700) >>  {
    }
    class db.TaskStatus << (T, #FF7700) >>  {
    }
}
"mongo.Client" *-- "db.MongoClient"


"__builtin__.string" #.. "db.ClusterName"
"__builtin__.string" #.. "db.ClusterStatus"
"__builtin__.string" #.. "db.ResourceStatus"
"__builtin__.string" #.. "db.ServiceName"
"__builtin__.string" #.. "db.TaskStatus"
@enduml
